﻿@model IEnumerable<VOD.Models.Notice>
@using VOD.Helpers
<!DOCTYPE html>
<html>
<head>
    <title>公告列表</title>
    <link href="@Url.Content("~/Content/Common.css")" rel="Stylesheet" />
    <style type="text/css">
        a{text-decoration:none;}
        table{width:880; border-collapse:collapse;}
        table th,table td{text-align:center;border:1px solid black;padding:4px;}
        tr:hover{background:yellow;cursor:pointer;}
        td.content{text-align:left;}
    </style>
</head>
<body>
    <table>
        <tr>
            <th width="100">
                标题
            </th>
            <th width="400">
                内容
            </th>
            <th width="125">
                添加时间
            </th>
            <th width="125">
                过期时间
            </th>
            <th width="125">
                操作
            </th>
        </tr>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @item.NoticeTitle
                </td>
                <td class="content">
                    @Html.Truncate(item.NoticeContent, 52)
                </td>
                <td>
                    @item.AddDate.ToString("yyyy-MM-dd hh:mm:ss")
                </td>
                <td>
                    @((item.InvalidDate == null) ? "无" : Convert.ToDateTime(item.InvalidDate).ToString("yyyy-MM-dd hh:mm:ss"))
                </td>
                <td>
                    @Html.ActionLink("编辑", "Edit", new { id = item.NoticeID }) |
                    @Html.ActionLink("详情", "Details", new { id = item.NoticeID }) |
                    @Html.ActionLink("删除", "Delete", new { id = item.NoticeID })
                </td>
            </tr>
        }
    </table>
</body>
</html>
